import angular from 'angular';
import template from './footer-detail.component.html';
import './footer-detail.component.scss'

let sc, q, parse;
class FooterDetailController {
  constructor($scope, $q, $parse) {
    sc = $scope;
    q = $q;
    parse = $parse;
  }

  $onInit() {
    console.log('$onInit:');
    // let model = parse('ctrl.info');
    // q.resolve(this.info)
    //   .then(info => {
    //     console.log('info:', info);
    //   });
    sc.$watch('ctrl.info', (newVal, oldVal) => {
      console.log('oldVal:', oldVal);
      console.log('newVal:', newVal);
    })
  }

  $onChanges(opt) {
    // console.log(opt);
  }

  $onDestroy() {
  }

  $postLink() {
  }
}

FooterDetailController.$inject = ['$scope', '$q', '$parse'];

export default angular.module('footerDetail', [])
  .component('footerDetail', {
    restrict: 'E',
    template: template,
    controller: FooterDetailController,
    controllerAs: 'ctrl',
    bindings: {
      info: '='
    }
  })
  .name;